﻿using Microsoft.AspNetCore.Mvc.Filters;

namespace Common.Core.Attributes
{
    /// <summary>
    /// 功能权限属性配置
    /// </summary>
    [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, AllowMultiple = true)]
    public class PermissionAttribute : ActionFilterAttribute
    {
        /// <summary>
        /// 权限key，*为通用权限
        /// </summary>
        public string Key { get; set; }

        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="function">权限key，多个逗号分开，注意是或的关系，*为通用权限</param>
        public PermissionAttribute(string keys)
        {
            Key = keys;
        }
    }
}
